<!DOCTYPE html>
<html>

<head>
    <include file="Share:meta" />
    <style type="text/css">
    .trstyle0 {
        background-color: #e8e8e8;
    }
    </style>
</head>

<body oncontextmenu="self.event.returnValue=false" ondragstart="return false" class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
        <include file="Share:header" />
        <include file="Share:left" />
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>物品库存列表<small><a target="_blank"></a></small></h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li class="active">物品库存列表</li>
                </ol>
            </section>
            <!-- Main content -->
            <section class="content">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">列表</h3>
                        <div class="box-tools">
                            <form action="/Shop/stocklist/" method="GET" role="form">
                                <div class="input-group input-group-sm">
                                    <div class="col-xs-5">
                                        <select name="shopid" id="shopid" class="form-control" >
                                            <option value="">请选择门店</option>
                                            <volist name="shoplist" id="vo">
                                                <option value="{$vo.tid}">{$vo.shopname}</option>
                                            </volist>
                                        </select>
                                        <script type="text/javascript">
                                            $('#shopid').val('{$Think.get.shopid}');
                                        </script>
                                    </div>
                                    <div class="col-xs-5">
                                        <input type="text" name="keyWord" class="form-control pull-right" placeholder="请输入关键字" value="{$Think.get.keyWord}">
                                    </div>
                                    <div class="col-xs-2 input-group-btn">
                                        <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <table class="table table-hover table-bordered HjTable" border="1">
                            <tbody>
                                <tr style="background-color: #E6E6FA;">
                                    <th style="width: 7%;">编号</th>
                                    <th style="width: 10%;">门店名称</th>
                                    <th style="width: 10%;">物品编码</th>
                                    <th style="width: 18%;">物品名称</th>
                                    <th style="width: 8%;">库存数量</th>
                                    <th style="width: 12%;">创建时间</th>
                                    <th style="width: 10%">
                                        <a class="btn btn-success" href="/Shop/stockdetail/opt/add" role="button">新增</a>
                                        <a class="btn btn-success" href="#" onclick="init();" role="button">初始化</a>
                                    </th>
                                </tr>
                                <notempty name="list">
                                    <volist name="list" id="vo">
                                        <tr>
                                            <!--class='trstyle{$vo.status}' -->
                                            <td>{$i}</td>
                                            <td>{$vo.shopname}</td>
                                            <td>{$vo.goods_code}</td>
                                            <td>{$vo.goods_name}</td>
                                            <td>
                                                <a class="btn btn-info" href="/Shop/updateStock/tid/{$vo.tid}" role="button">{$vo.stock_num}</a>
                                            </td>
                                            <td>{$vo.ctime}</td>
                                            <td>
                                                <a class="btn btn-info" href="/Shop/updateStock/tid/{$vo.tid}" role="button">修改/查看</a>
                                                <!-- <a class="btn btn-info" href="/Shop/stockdetail/tid/{$vo.tid}/opt/edit" role="button">详细</a> -->
                                                <!-- <a class="btn btn-danger" href="/Shop/stockdetail/tid/{$vo.tid}/opt/del" onclick="if(confirm('删除不可恢复,确定删除?')){return true;}else{return false;}" role="button">删除</a> -->
                                            </td>
                                        </tr>
                                    </volist>
                                    <else />
                                    <tr class='trstyle{$vo.is_forbit}'>
                                        <!--class='trstyle{$vo.status}' -->
                                        <td colspan="7">没有找到相关记录</td>
                                    </tr>
                                </notempty>
                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer clearfix">
                        <ul class="pagination pagination-sm no-margin pull-right">
                            {$show}
                        </ul>
                    </div>
                </div>
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->
        <include file="Share:copyright" />
        <include file="Share:setting" />
    </div>
    <include file="Share:js" />
    <script type="text/javascript">
        $("#ShopManager").addClass("active");
        $("#stock_list").addClass("active");

        function init(){
            if ($("#shopid").val() == "" || $("#shopid").val() == "null"){
                alert("请选择门店进行初始化!");
                return;
            }
            window.location.href = "/Shop/stockdetail/opt/init/shopid/"+$("#shopid").val();
        }
    </script>
</body>

</html>
